
clear classes


origin = 'C:\Users\del.l\Documents\UCL\data\';

experiment = 2;
subject = 3;

for j = 1
    for i = 1
        fname = [ 's' num2str(subject) 'e' ...
                num2str(experiment) 'b' num2str(j) 't' num2str(i) '.asc'];
        try
            edff = ASCFILE([origin fname]);
        catch err
            fprintf(1,err.message);
            continue
        end
        analysis = ET_ANALYSIS(edff);
        analysis.refresh_rate = analysis.resample;
%        save2pdf(['../../../data_1/' fname '.pdf'],h);
        

    end
end

[s p0] = analysis.edffile.rawSignal();
st = analysis.edffile.start();
f  = analysis.edffile.final();

v = analysis.returnVectors(1);

s = analysis.edffile.interpolateSignal(s(st{1}{1}-p0:f{1}{1}-p0));
s = analysis.edffile.filter(s,60,1000);
s = s(round(1:16.6666:numel(s))); % This is very sloppy

v = (v-analysis.scn.w/2)/(analysis.scn.w/2);
s = (s-analysis.scn.w/2)/(analysis.scn.w/2);
v = (v/analysis.randomFixation());
s = (s/analysis.randomFixation());

ox = analysis.occluder.X;
ow = analysis.occluder.W;

ox = (ox)/(analysis.scn.w/2);
ow = (ow)/(analysis.scn.w/2);
ox = (ox/analysis.randomFixation());
ow = (ow/analysis.randomFixation());

figure
hold on
plot(s,'r'); 
plot(v,'k'); 




